<template>
  <div>
    <!--顶部导航-->
    <el-breadcrumb separator-class="el-icon-arrow-right" style="font-size: 16px;">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>统计查询</el-breadcrumb-item>
      <el-breadcrumb-item>收费信息查询</el-breadcrumb-item>
    </el-breadcrumb>
    <el-divider></el-divider>



    <!-- 表单 -->
    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
      <el-form-item label="ID：">
        <el-input v-model="ruleForm.division" placeholder="请输入收费表编号"></el-input>
      </el-form-item>
      <el-form-item label="医师：">
        <el-input v-model="ruleForm.doctorName" placeholder="请输入医师姓名"></el-input>
      </el-form-item>
      <el-form-item label="日期：">
        <el-input v-model="ruleForm.date" placeholder="请输入日期"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="submitForm('ruleForm')">查询</el-button>
        <el-button @click="resetForm('ruleForm')">重置</el-button>
      </el-form-item>
    </el-form>





    <template>
      <el-table
          :data="tableData"
          style="width: 100%">
        <el-table-column
            label="日期"
            width="180">
          <template slot-scope="scope">
            <i class="el-icon-time"></i>
            <span style="margin-left: 10px">{{ scope.row.date }}</span>
          </template>
        </el-table-column>
        <el-table-column
            label="姓名"
            width="180">
          <template slot-scope="scope">
            <el-popover trigger="hover" placement="top">
              <p>姓名: {{ scope.row.name }}</p>
              <p>基本概况: {{ scope.row.content }}</p>

              <div slot="reference" class="name-wrapper">
                <el-tag size="medium">{{ scope.row.name }}</el-tag>
              </div>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button
                size="mini"
                @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
            <el-button
                size="mini"
                type="danger"
                @click="handleDelete(scope.$index, scope.row)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </template>




  </div>
</template>


<script>
export default {
  data() {
    return {
      ruleForm: {
        division: '',
        doctorName: '',
        date: ''
      },
      // 表单规则
      rules: {

      },

      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        content: '无病史'
      }, {
        date: '2016-05-04',
        name: '张三',
        content: '哮喘病史'
      }, {
        date: '2016-05-01',
        name: '李四',
        content: '无病史'
      }, {
        date: '2016-05-03',
        name: '王五',
        content: '无病史'
      }]
    }
  },
  methods: {
    // 提交表单
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {

      });
    },
    // 重置表单
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
    handleEdit(index, row) {
      console.log(index, row);
    },
    handleDelete(index, row) {
      console.log(index, row);
    }
  }
}
</script>

<style>
</style>